from flask import Flask,session
import os

app=Flask(__name__)
app.secret_key=os.urandom(256)

@app.route('/')
def hello():
    return 'hello world'

@app.route('/set')
def set():
    session['lidabao']='123456'
    return '已经设置好session了'

@app.route('/get')
def get():
    result=session.get('lidabao')
    return result or 'this is result'

@app.route('/delete')
def delete():
    session.pop('lidabao')
    return '已经删除了'

if __name__=='__main__':
    app.run(debug=True)